import Vue from 'vue'
import Router from 'vue-router'

const index = (resolve) => {
  import('components/index').then((module) => {
    resolve(module)
  })
}
const allClass = (resolve) => {
  import('components/allClass').then((module) => {
    resolve(module)
  })
}
const search = (resolve) => {
  import('components/search').then((module) => {
    resolve(module)
  })
}
const detial = (resolve) => {
  import('components/itemDetial').then((module) => {
    resolve(module)
  })
}
const pay = (resolve) => {
  import('components/pay').then((module) => {
    resolve(module)
  })
}
const shop_car = (resolve) => {
  import('components/shop_car').then((module) => {
    resolve(module)
  })
}
const my = (resolve) => {
  import('components/my').then((module) => {
    resolve(module)
  })
}
const orderConfirm = (resolve) => {
  import('components/orderConfirm').then((module) => {
    resolve(module)
  })
}
const myOrder = (resolve) => {
  import('components/myOrder').then((module) => {
    resolve(module)
  })
}
const myOrders = (resolve) => {
  import('components/myOrders').then((module) => {
    resolve(module)
  })
}
const orderDetial = (resolve) => {
  import('components/orderDetial').then((module) => {
    resolve(module)
  })
}
const admin = (resolve) => {
  import('components/admin').then((module) => {
    resolve(module)
  })
}
const setUser = (resolve) => {
  import('components/setUser').then((module) => {
    resolve(module)
  })
}
const address_admin = (resolve) => {
  import('components/address_admin').then((module) => {
    resolve(module)
  })
}
const coupon_center = (resolve) => {
  import('components/mine/coupon_center').then((module) => {
    resolve(module)
  })
}
const coupon_list = (resolve) => {
  import('components/mine/coupon_list').then((module) => {
    resolve(module)
  })
}
const exchange = (resolve) => {
  import('components/mine/exchange').then((module) => {
    resolve(module)
  })
}
const about_us = (resolve) => {
  import('components/mine/about_us').then((module) => {
    resolve(module)
  })
}
const feedback = (resolve) => {
  import('components/mine/feedback').then((module) => {
    resolve(module)
  })
}
const photo_list = (resolve) => {
  import('components/mine/photo_list').then((module) => {
    resolve(module)
  })
}
const service_policy = (resolve) => {
  import('components/mine/service_policy').then((module) => {
    resolve(module)
  })
}
const SharedSurpriseVue = (resolve) => {
  import('components/mine/shared_surprise').then((module) => {
    resolve(module)
  })
}
const AppraiseListVue = (resolve) => {
  import('components/appraise/appraise_list').then((module) => {
    resolve(module)
  })
}
const AppraiseCommodityVue = (resolve) => {
  import('components/appraise/appraise_commodity').then((module) => {
    resolve(module)
  })
}
const PayVue = (resolve) => {
  import('components/payment/pay').then((module) => {
    resolve(module)
  })
}
const PayResultVue = (resolve) => {
  import('components/payment/pay_result').then((module) => {
    resolve(module)
  })
}
const AppraiseSuccessVue = (resolve) => {
  import('components/appraise/appraise_sucess').then((module) => {
    resolve(module)
  })
}
const couponList = (resolve) => {
  import('components/coupon_list').then((module) => {
    resolve(module)
  })
}
const UploadPhotosVue = (resolve) => {
  import('components/appraise/upload_photos').then((module) => {
    resolve(module)
  })
}
const commentList = (resolve) => {
  import('components/comment_list').then((module) => {
    resolve(module)
  })
}
const ExchangeOrderVue = (resolve) => {
  import('components/mine/exchange_order').then((module) => {
    resolve(module)
  })
}
const iframe = (resolve) => {
  import('components/iframe_wrap').then((module) => {
    resolve(module)
  })
}

// import index from 'components/index'
// import allClass from 'components/allClass'
// import search from 'components/search'
// import detial from 'components/itemDetial'
// import pay from 'components/pay'
// import shop_car from 'components/shop_car'
// import my from 'components/my'
// import orderConfirm from 'components/orderConfirm'
// import myOrder from 'components/myOrder'
// import myOrders from 'components/myOrders'
// import orderDetial from 'components/orderDetial'
// import admin from 'components/admin'
// import setUser from 'components/setUser'
// import address_admin from 'components/address_admin'
// import coupon_center from 'components/mine/coupon_center'
// import coupon_list  from 'components/mine/coupon_list'
// import exchange     from 'components/mine/exchange'
// import about_us     from 'components/mine/about_us'
// import feedback     from 'components/mine/feedback'
// import photo_list   from 'components/mine/photo_list'
// import service_policy from 'components/mine/service_policy'
// import SharedSurpriseVue from 'components/mine/shared_surprise'
// import AppraiseListVue from 'components/appraise/appraise_list'
// import AppraiseCommodityVue from 'components/appraise/appraise_commodity'
// import PayVue from 'components/payment/pay'
// import PayResultVue from 'components/payment/pay_result'
// import AppraiseSuccessVue from 'components/appraise/appraise_sucess'
// import couponList from 'components/coupon_list'
// import UploadPhotosVue from 'components/appraise/upload_photos'
// import commentList from 'components/comment_list'
// import ExchangeOrderVue from 'components/mine/exchange_order'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '/index',
      component: index,
      children: [
        {
          path: 'detial',
          component: detial
        }
      ]
    },
    {
      path: '/allClass',
      component: allClass,
      children: [
        {
          path: 'detial',
          component: detial
        }
      ]
    },
    {
      path: '/search',
      component: search,
      children: [
        {
          path: 'detial',
          component: detial
        }
      ]
    },
    {
      path: '/pay',
      component: pay
    },
    {
      path: '/commentList',
      component: commentList
    },
    {
      path: '/shop_car',
      component: shop_car,
      children: [
        {
          path: 'detial',
          component: detial
        }
      ]
    },
    {
      path: '/myOrder',
      component: myOrder,
      children: [
        {
          path: 'orderDetial',
          component: orderDetial
        }
      ]
    },
    {
      path: '/myOrders',
      component: myOrders,
      children: [
        {
          path: 'orderDetial',
          component: orderDetial
        }
      ]
    },
    {
      path: '/orderDetial',
      component: orderDetial
    },
    {
      path: '/my',
      component: my,
    },
    {
      path: '/orderConfirm',
      component: orderConfirm,
      children: [
        {
          path: 'couponList',
          component: couponList
        }
      ]
    },
    {
      path: '/admin',
      component: admin
    }, {
      path: '/setUser',
      component: setUser
    }, {
      path: '/address_admin',
      component: address_admin
    },
    {
      path: '/orderConfirm',
      component: orderConfirm
    },
    {
      path: '/coupon_center',
      component: coupon_center
    },
    {
      name: '/shared_surprise',
      path: '/shared_surprise',
      component: SharedSurpriseVue
    },
    {
      name: '/coupon_list',
      path: '/coupon_list',
      component: coupon_list
    },
    {
      name: '/exchange',
      path: '/exchange',
      component: exchange
    },
    {
      name: '/about_us',
      path: '/about_us',
      component: about_us
    },
    {
      name: '/feedback',
      path: '/feedback',
      component: feedback
    },
    {
      name: '/photo_list',
      path: '/photo_list',
      component: photo_list
    },
    {
      name: '/service_policy',
      path: '/service_policy',
      component: service_policy
    },
    {
      name: '/appraise_list',
      path: '/appraise_list',
      component: AppraiseListVue
      // children: [
      //   {
      //     name: 'appraise_commodity',
      //     path: 'appraise_commodity',
      //     component: AppraiseCommodityVue
      //   }
      // ]
    },
    {
      name: '/appraise_commodity',
      path: '/appraise_commodity',
      component: AppraiseCommodityVue
    },
    {
      name: '/payment/pay',
      path: '/payment/pay',
      component: PayVue
    },
    {
      name: '/pay_result',
      path: '/pay_result',
      component: PayResultVue
    },
    {
      name: '/upload_photos',
      path: '/upload_photos',
      component: UploadPhotosVue
    },
    {
      name: '/appraise_sucess',
      path: '/appraise_sucess',
      component: AppraiseSuccessVue
    },
    {
      name: '/exchange_order',
      path: '/exchange_order',
      component: ExchangeOrderVue
    },
    {
      name: '/iframe',
      path: '/iframe',
      component:iframe
    }
  ]
})
